#!/bin/bash
i=1
b=0
c=0
while [ $i -le 5 ]
do
  IP="192.168.4.$i"
  ping -c 3 -i 0.2 -W 1 $IP &>/dev/null
 if [ $? -eq 0 ];then
 echo "host $IP is up"
 let b++
 else 
   echo "host $ip is down"
  let c++
	fi
   let i++
done
echo $b $c
